<?php if(count($this->messages) > 0){
    foreach ($this->messages as $message){
        if (strpos($message, "successfully")){
            ?>
           <div class="alert alert-success alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                                    <?php 
                                        echo "<strong>$message</strong>";
                                        echo '</div>';
        } else{
            ?>
            <div class="alert alert-danger alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                                    <?php 
                                        echo "<strong>$message</strong>";
                                        echo '</div>';
            
        }
        }
}
        ?>

<div id="delete_div" class="alert alert-danger fade in">
            
    <h4><strong>Delete Action!</strong></h4>
            <p>Are you sure that you want to delete this item ?</p>
            <p>
              <a id="delete_action" class="btn btn-danger" href="#">Ok, Delete</a> <a id="keep_action" class="btn btn-default"  href="#">No, Keep it</a>
            </p>
</div>
<div class="panel panel-primary">
    <div class="panel-heading">
    <h3 class="panel-title">List Pages</h3>
  </div>
<div class="panel-body">
    <div class="pull-right"><a id="addAction" class="btn btn-primary " href="<?php echo $this->baseUrl() ?>/administration/page/add"><span class="glyphicon glyphicon-plus"></span> Add Page</a></div>
<?php
    
    if(count($this->paginator)){
        
    
        ?>
    
        <table class="table table-hover">
            <thead>
                <th>Page Id</th>
                <th>Page Title</th>
                <th>Actions</th>
            </thead>
            <tbody>
            <?php
                    foreach($this->paginator as $page)
            {
                       echo "<tr>";
                       echo "<td>".$page['id']."</td>";
                       echo "<td>".$page['pageTitle']."</td>";
                       echo '<td><a href="'.$this->baseUrl().'/administration/page/edit/id/'.$page['id'].'"><i class="glyphicon glyphicon-edit"></i></a>';
                       echo '<a href="#"><i class="glyphicon glyphicon-remove" id="delete_'.$page['id'].'"></i></a>';
                       
                       echo '</td>';
                       echo "</tr>";
                    }
            ?>
                </tbody>
        </table>
     
    <?php
    
    echo $this->paginationControl($this->paginator, 'sliding', 'pagination.phtml');
    }  else {
    ?>
    <div>You do not have any pages</div>
    <?php     } ?>
</div>
</div>